package draw;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JPanel;


import tree.Simulation;
import tree.Tree;

public class DrawPanel extends JPanel implements Observer{

	private Simulation sim;
	public boolean drawDebug = false;
	public DrawPanel(Simulation sim){
		this.sim = sim;
	}
	
	public void paintComponent(Graphics g){
		super.paintComponent(g);
		g.setColor(Color.white);
		g.fillRect(0,0,1000,1000);
		sim.getRoad().draw(g);
		if(drawDebug)
		sim.getRoad().drawDebug(g);
		g.setColor(Color.black);
		//Road.drawTaperedLine(400,600,400,200,500,100, g);	
	}
	
	@Override
	public void update(Observable arg0, Object arg1) {
		// TODO Auto-generated method stub
	repaint();
	}
}
